<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>跳转提示</title>
    <script type="text/javascript" src="__PUBLIC_LIB__/jquery/jquery.min.js?v=1.9.1"></script>
    <script type="text/javascript" src="__PUBLIC_LIB__/layer/layer.js?v=2.1"></script>
</head>
<body>
<input type="hidden" id="msg" name="msg" value="<present name="message"><?php echo($message); ?><else/><?php echo($error); ?></present>" />
<input type="hidden" id="url" name="url" value="<?php echo(strip_tags($jumpUrl));?>" />
<input type="hidden" id="wait" name="wait" value="<?php echo(strip_tags($waitSecond));?>" />
<input type="hidden" id="status" name="status" value="<present name="message"><?php echo 1; ?><else/><?php echo 2; ?></present>" />

<script type="text/javascript">
    (function(){
        var msg = $('#msg').val();
        var url = $('#url').val();
        var wait = $('#wait').val();
        var status = $('#status').val();

        layer.open({
            icon: status,
            offset: '100px',
            content: msg,
            btn: ['确定'],
            shade: 0,
            yes: function(index, layero){ //或者使用btn1
                location.href = url;
            },
            cancel: function(index){ //或者使用btn2
                location.href = url;
            },
        });

        var interval = setInterval(function(){
            var time = --wait;
            if(time <= 0) {
                location.href = url;
                clearInterval(interval);
            };
        }, 1000);
    })();
</script>
</body>
</html>
